package com.tangyuan.feignapis.user;

import com.tangyuan.common.result.Result;
import com.tangyuan.common.result.ResultCodeEnum;
import com.tangyuan.dto.GivingLiveGiftDto;
import com.tangyuan.model.UserBalance;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(name = "service-user",contextId = "userBalance")
public interface IUserBalanceFeignClient {

    @GetMapping("/feignApi/user/getUserBalance")
    UserBalance getUserBalance(@RequestParam(value = "userId") Long userId);

    @PostMapping("/feignApi/user/saveUserBalance")
    void saveUserBalance(@RequestBody UserBalance userBalance);

    @PostMapping("/feignApi/user/verifyParameter")
    Result<ResultCodeEnum> verifyParameter(@RequestBody GivingLiveGiftDto givingLiveGiftDto);

    @PostMapping("/feignApi/user/giveLiveGiftUpdateBalance")
    Result<Map<String, UserBalance>> giveLiveGiftUpdateBalance(@RequestBody GivingLiveGiftDto givingLiveGiftDto);

    @PostMapping("/feignApi/user/refundLiveGiftUpdateBalance")
    Result<ResultCodeEnum> refundLiveGiftUpdateBalance(@RequestBody GivingLiveGiftDto givingLiveGiftDto);
}
